package com.bis.ymyy.service.impl;

import com.bis.ymyy.entity.Appointment;
import com.bis.ymyy.mapper.AppointmentMapper;
import com.bis.ymyy.service.AppointmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

@Service
public class AppointmentServiceImpl implements AppointmentService {

    @Autowired
    private AppointmentMapper appointmentMapper;

    @Override
    public int addOne(Appointment appointment) {
        return appointmentMapper.addOne(appointment);
    }

    @Override
    public int cancelOne(String userName) {
        return appointmentMapper.cancelOne(userName);
    }

    @Override
    public List<Appointment> findAll() {
        return appointmentMapper.findAll();
    }

    @Override
    public List<Appointment> findByDate(Date data) {
        return appointmentMapper.findByDate(data);
    }

    @Override
    public Appointment findByUserName(String userName) {
        return appointmentMapper.findByUserName(userName);
    }

    @Override
    public int modifyAppointment(Appointment appointment) {
        return appointmentMapper.modifyAppointment(appointment);
    }
}
